﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using jQuery.Validation.DataAnnotations;

namespace jQuery.Validation.Web.Models
{
    [EqualTo("VerificationPassword", "Password")]
    public class Registration
    {
        [Required(ErrorMessage="Yo, I am required.")]
        [MaxLength(10, ErrorMessage = "Only up to 10 chars please.")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "Yo, I fill me out.")]
        [Email]
        [MinLength(10, ErrorMessage = "Atleast 10 chars are required.")]
        public string EmailAddress { get; set; }

        [Required]
        [RangeLength(6, 8, ErrorMessage = "6-8 chars please")]
        public string Password { get; set; }

        [Required]
        public string VerificationPassword { get; set; }

        [Digits]
        [Min(18, ErrorMessage="Only Adults here. 18+")]
        [Max(110, ErrorMessage="You look to young to be that older than 110.")]
        public int Age { get; set; }

        [Url(ErrorMessage="Urls only.")]
        public string WebSite { get; set; }

        [Number(ErrorMessage = "xyz is not a blance, only numbers please oh and decimal places if you want.")]
        public decimal BankBalance { get; set; }

        [CreditCard(ErrorMessage="You need to enter a real CC number. 1234 5678 9101 1121, doesnt work.")]
        public string CreditCard { get; set; }

        [RangeLength(10,20)]
        public string Comments { get; set; }

        [Date(ErrorMessage="Enter a real date please. 1/1/2009 come on anything please. ")]
        [Required]
        public string BirthDate { get; set; }

        [Accept("jpg|jpeg|png|gif", ErrorMessage="Pictures only")]
        public string ProfilePicture { get; set; }
    }
}
